<template>
  <div>
    <h2>深入v-model</h2>

    <input type="text" v-model="msg">
    <span>我爱你{{msg}}</span>
    <br>
    <!-- v-model其实是单项数据绑定v-bind和input事件的组合 -->
    <input type="text" :value='msg' @input="msg=$event.target.value">
    <span>我爱你{{msg}}</span>
    <CustomInput :value='msg' @input="msg=$event"></CustomInput>
    <CustomInput v-model="msg"></CustomInput>



    <el-input v-model="msg"></el-input>

  </div>
</template>

<script type="text/ecmascript-6">
  import CustomInput from './CustomInput.vue'
  export default {
    name: 'ModelTest',
    components: {
      CustomInput
    },
    data(){
      return{
        msg:'赵丽颖'
      }
    }
  }
</script>
